-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.java
42 lines (32 loc) · 901 Bytes
/
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import java.io.IOException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
int x, y, z, menor = 0, meio = 0, maior = 0;
x = sc.nextInt();
y = sc.nextInt();
z = sc.nextInt();
if (x < y && x < z)
menor = x;
else if (x > y && x > z)
maior = x;
else
meio = x;
if (y < x && y < z)
menor = y;
else if (y > x && y > z)
maior = y;
else
meio = y;
if (z < x && z < y)
menor = z;
else if (z > x && z > y)
maior = z;
else
meio = z;
System.out.println(menor + "\n" + meio + "\n" + maior + "\n");
System.out.println(x + "\n" + y + "\n" + z);
sc.close();
}
}